const {contextBridge, ipcRenderer} = require('electron')

contextBridge.exposeInMainWorld('electronAPI', {
    openFolderDialog: () => ipcRenderer.invoke('open-folder-dialog'),
    readDir: (dirPath) => ipcRenderer.invoke('read-dir', dirPath),
    renameFileOrDir: (oldPath, newName) => ipcRenderer.invoke('rename-file-or-dir', oldPath, newName),
    readTextFile: (filePath) => ipcRenderer.invoke('read-text-file', filePath),
    writeTextFile: (filePath, content) => ipcRenderer.invoke('write-text-file', filePath, content),
    deleteFileOrDir: (filePath) => ipcRenderer.invoke('delete-file-or-dir', filePath),
    createDirectory: (dirPath) => ipcRenderer.invoke('create-directory', dirPath),
    moveFileOrDir: (sourcePath, targetPath) => ipcRenderer.invoke('move-file-or-dir', sourcePath, targetPath),
})